package com.example.entity;

import com.example.annotation.ConvertEntity;
import com.example.annotation.ConvertField;
import com.example.annotation.ConvertSame;

import java.util.Date;
@ConvertEntity(value = EntityDto.class)
public class Entity extends ParentEntity{
    @ConvertField("name")
    private String name;
    @ConvertField("age")
    private Integer age;
    @ConvertField("date")
    private Date date;
    @ConvertField("sex")
    private int sex;
    @ConvertField("isTrue")
    private  Boolean isTrue;
    @ConvertField("ther")
    private String ther;
//    @ConvertSame()
//    private Entity myself;

    public Entity() {
        System.out.println("Entity() ");
    }

    public Entity(String name, Integer age, Date date, int sex, Boolean isTrue,String ther) {
        this.name = name;
        this.age = age;
        this.date = date;
        this.sex = sex;
        this.isTrue = isTrue;
        this.ther = ther;
    }
    //@ConvertField("name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    @ConvertField("age")
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
    @ConvertField("date")
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
    @ConvertField("sex")
    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }
    @ConvertField("isTrue")
    public Boolean getTrue() {
        return isTrue;
    }

    public void setTrue(Boolean aTrue) {
        isTrue = aTrue;
    }
    @ConvertField("ther")
    public String getTher() {
        return ther;
    }

    public void setTher(String ther) {
        this.ther = ther;
    }
    //@ConvertField("myself")
//    public Entity getMyself() {
//        return myself;
//    }
//    public void setMyself(Entity myself) {
//        this.myself = myself;
//    }

    @Override
    public String toString() {
        return "Entity{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", date=" + date +
                ", sex=" + sex +
                ", isTrue=" + isTrue +
                ", ther='" + ther + '\'' +
                //", myself=" + myself +
                '}';
    }
}
